function [ convresult ] = APEraman2lambda( val2conv, valtype, laserWL )
%[ convresult ] = APEraman2lambda( val2conv, valtype, laserWL )
%
%  Convert Raman shift to wavelenght or vise versa
%
%  INPUT  val2conv   :   Value to convert
%         valtype    :   Type of val2conv:
%                          'r' = Raman shift (-> conv. to wavelength (nm))
%                          'w' = Wavelength  (-> conv. to Raman shift (cm^-1))
%         laserWL    :   Wavelength of ex. Laser (in nm)
%
%  OUPUT  convresult :   Result of the performed conversion.

%  (c) F. Dworkowski, 2011
%      Version 1.0, 2011-07-20


if nargin < 2
    help APEraman2lambda
    return
elseif nargin < 3
        errordlg({'Please give a LaserWL to convert' ...
                  'Raman shift to wavelength!'})
      return
end


switch valtype
    case 'r'          % Raman shift is given
        convresult=(1/((1/laserWL)-(val2conv/1e7)));
     
    case 'w'          % Wavelength is given
        convresult=((1/laserWL)-(1/val2conv))*1e7;
        
    otherwise
        errordlg({'Please give correct input parameters!'})
        return
end

end

